home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.2 / Video Toaster v4.2.iso / arexx / editor / changeicon.rexx < prev    next >
OS/2 REXX Batch file  |  1995-10-26  |  2KB  |  71 lines

  1. /* ChangeIcon.rexx V1.1 -- Change the icon on a clip.                     */
  2. /* By Bob Caron (Grue) ©1995 NewTek Inc.                                  */
  3.  
  4. numeric digits 12
  5.  
  6. call remlib('PROJECT_REXX_PORT')
  7. call addlib('PROJECT_REXX_PORT',0)
  8.  
  9. /* The following stuff is just to get a filename with a path */
  10.  
  11. call req_error("Change Icon V1.1     ---    Change the icon of a flyer clip.")
  12.  
  13. rx startfilereq("Choose a clip to change its icon.","","")
  14.  
  15. exit=1
  16. do while exit=1
  17.   file=queryfilereq()
  18.   if file=0 then call quit
  19.   if file~="" then exit=0
  20.   address command "c:wait 1"
  21. end
  22.  
  23. if lastpos('/',file,length(file)-1)~=0 then do
  24.    filenam=right(file,(length(file)-lastpos('/',file,length(file)-1)))
  25.    path=left(file,(lastpos('/',file,length(file))-1))
  26.    end
  27. else do
  28.    filenam=right(file,(length(file)-lastpos(':',file,length(file)-1)))
  29.    path=left(file,(lastpos(':',file,length(file))))
  30.    end
  31.  
  32. address command "c:cd "path
  33.  
  34. call pragma("D",path)
  35. path=pragma("D","RAM:")
  36.  
  37. if right(path,1)=":" then Source=path||filenam
  38. else Source=path||"/"||filenam
  39.  
  40. if isclip(source)=0 then do
  41.    call req_tell("Error!","            That isn't a clip!")
  42.    call quit()
  43.    end
  44.  
  45. icontime=REQ_FLYERJOG("Choose frame for icon.",source,1)
  46.  
  47. if icontime="CANCEL" then call quit
  48.  
  49. icontime=(icontime*2)
  50.  
  51. call makeicon(source,icontime)
  52.  
  53. call req_error("All done.")
  54.  
  55. call remlib('PROJECT_REXX_PORT')
  56.  
  57. exit
  58.  
  59. quit: PROCEDURE
  60.    call req_error("Canceled.")
  61.    call remlib('PROJECT_REXX_PORT')
  62.    exit
  63.  
  64. isclip:
  65. parse arg clipname
  66. if open('CLIP',clipname,'R') then do
  67.    padding=readch('CLIP',12)
  68.    if substr(padding,1,4)='CLIP' then return 1
  69.    end
  70. call close ('Clip')
  71. return 0